// https://nuxt.com/docs/api/configuration/nuxt-config
import path from 'path';
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';

export default defineNuxtConfig({
  compatibilityDate: '2024-04-03',
  devtools: { enabled: false },
  devServer: {
    port: Number(process.env.PORT || 3000),
  },
  runtimeConfig: {
    public: {
      baseURL: process.env.BASE_URL,
      soServiceUrlTest: process.env.SO_SERVICE_URL_TEST,
      soServiceUrlProd: process.env.SO_SERVICE_URL_PROD
    }
  },
  typescript: {
    typeCheck: true
  },
  modules: [
    '@element-plus/nuxt',
    '@pinia/nuxt',
    '@pinia-plugin-persistedstate/nuxt',
    '@nuxtjs/i18n'
  ],
  i18n: {
    strategy: 'prefix_except_default',
    locales: ['en-US', 'zh-CN'],
    defaultLocale: 'zh-CN',
    vueI18n: '@@/i18n/config.ts',
  },
  css: [
    'element-plus/dist/index.css',
    'element-plus/theme-chalk/display.css',
    '@@/assets/styles/index.less'
  ],
  vite: {
    plugins: [
      createSvgIconsPlugin({
        iconDirs: [path.resolve(process.cwd(), 'assets/icons/svg')],
      })
    ]
  }
})
